Writing loops with i++ or ++i [duplicate]

Posted by Nonesuch on Stack Overflow See other posts from Stack Overflow or by Nonesuch
Published on 2013-11-02T21:21:52Z Indexed on 2013/11/02 21:54 UTC
Read the original article Hit count: 150

Filed under:
|

I have a question about writing loops. I always begin with

(int i=0; i<10; i++)

But I see many experts begin with

(int i=0; i<10; ++i)

Is there there any real difference, or they are same?

Of course, I know the difference between pre-increment and post-increment. I mean which one I should use when writing the loop? or it depends.

Thanks!

© Stack Overflow or respective owner

Related posts about c++

Related posts about c